package pro.softzhang.algo.lc200;

import java.util.HashMap;
import java.util.Map;

public class LC217_ContainsDuplicate {
    public static void main(String[] args) {

    }

    class Solution {
        public boolean containsDuplicate(int[] nums) {
            Map<Integer, Integer> m = new HashMap<>();
            for (int num : nums) {
                if (m.containsKey(num)) {
                    return true;
                } else {
                    m.put(num, 1);
                }
            }
            return false;
        }
    }
}
